﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ExamServer.Service
{
    public class RepositoryWrapper : IRepositoryWrapper
    {
        public ExamServerContext Context { get; }
        public RepositoryWrapper(ExamServerContext context)
        {
            Context = context;
        }

        private IQuestionTypeRepository _questionType = null;
        private IUsersRepository _users = null;
        private IMenusRepository _menus = null;

        public IUsersRepository Users => _users ?? new UsersRepository(Context);

        public IQuestionTypeRepository QuestionTypes => _questionType?? new QuestionTypeRepository(Context);

        public IMenusRepository Menus => _menus ?? new MenusRepository(Context);

        
    }
}
